package com.byfan.springboottemplate.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

/**
 * @ClassName: FileEntity
 * @Description:
 * @Author: byfan
 * @Date: 2023/7/28
 */
@Entity
@Data
@EntityListeners(AuditingEntityListener.class)
@ApiModel
@Table(name = "file")
public class FileEntity {
    @ApiModelProperty(value = "唯一标识")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;


    @ApiModelProperty(value = "原始文件名")
    @Column(name = "name")
    private String name;


    @ApiModelProperty(value = "下载地址")
    @Column(name = "path")
    private String path;

    @ApiModelProperty(value = "上传时间")
    @CreatedDate
    @Column(name = "create_time")
    private Date createTime;
}
